/* GUI CONVERTED from sosorp11.p (converter v1.75) Mon Sep 25 09:14:38 2000 */
/* sosorp11.p - -SHIPMENT HISTORY BY PART                                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert sosorp11.p (converter v1.00) Tue Sep 30 12:00:06 1997 */
/* web tag in sosorp11.p (converter v1.00) Mon Sep 29 14:35:40 1997 */
/*F0PN*/ /*K0L9*/ /*                                                       */
/*V8:ConvertMode=FullGUIReport                                       */
/* REVISION: 1.0           LAST EDIT: 10/17/87         MODIFIED BY: pml       */
/* REVISION: 2.0           LAST EDIT: 01/06/88                  BY: pml *A125**/
/* REVISION: 4.0           LAST EDIT: 02/12/88                  BY: FLM *A175**/
/* REVISION: 4.0           LAST EDIT: 02/08/89                  BY: JLC *C0028*/
/* REVISION: 5.0           LAST EDIT: 03/20/89                  BY: MLB *B072**/
/* REVISION: 5.0           LAST EDIT: 06/21/89                  BY: MLB *B130**/
/* REVISION: 6.0       LAST MODIFIED: 04/10/90                  BY: ftb *D002**/
/* REVISION: 6.0       LAST MODIFIED: 10/19/90                  BY: afs *D112**/
/* REVISION: 6.0       LAST MODIFIED: 12/02/90      (rev only)  BY: afs *D237**/
/* REVISION: 6.0       LAST MODIFIED: 03/08/91      (rev only)  BY: afs *D408**/
/* REVISION: 6.0       LAST MODIFIED: 07/13/91                  BY: afs *D769**/
/* REVISION: 7.2       LAST MODIFIED: 10/18/94                  BY: jzs *FS87**/
/* REVISION: 7.3       LAST MODIFIED: 04/10/96                  BY: jzw *G1P6**/
/* REVISION: 8.6       LAST MODIFIED: 10/04/97                  BY: ckm *K0L9**/
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/14/00   BY: *N0K6* Rajinder Kamra   */
/* REVISION: 9.1      LAST MODIFIED: 09/21/00   BY: *N0NM* Annasaheb Rahane */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*FS87*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE sosorp11_p_1 "Per Column"
/* MaxLen: Comment: */

&SCOPED-DEFINE sosorp11_p_2 "Day/Week/Month"
/* MaxLen: Comment: */

&SCOPED-DEFINE sosorp11_p_3 "Round to Thousands"
/* MaxLen: Comment: */

&SCOPED-DEFINE sosorp11_p_4 "Show Gross Margin"
/* MaxLen: Comment: */

/*N0K6
 * &SCOPED-DEFINE sosorp11_p_5 "Sales figures in thousands"
 * /* MaxLen: Comment: */
 *N0K6*/

/* ********** End Translatable Strings Definitions ********* */

define variable start like ro_start.
define variable ending like ro_end.
define new shared variable part like pt_part.
define new shared variable part1 like pt_part.
define new shared variable cust like tr_addr.
define new shared variable cust1 like tr_addr.
/*D002*/ define new shared variable site like tr_site.
/*D002*/ define new shared variable site1 like tr_site.
define new shared variable buyer like pt_buyer.
define new shared variable prod_line like pt_prod_line.
define new shared variable ptgroup like pt_group.
define new shared variable part_type like pt_part_type.
define new shared variable vendor like pt_vend.
define new shared variable pm_code like pt_pm_code.
define variable interval as integer extent 14 format "->>>,>>9".
define new shared variable sdate as date extent 14.
define variable i as integer.
define variable dwm as character format "!(1)" label {&sosorp11_p_2}.
define variable idays as integer format ">>>>>9" label {&sosorp11_p_1}.
define variable monthend as integer.
define new shared variable num_intervals as integer initial 13 format "9".
define new shared variable show_profit like mfc_logical
  label {&sosorp11_p_4} initial "yes".
define new shared variable base_rpt like so_curr.
/*G1P6*  initial "Base" format "x(4)". */
/*D112*/ define new shared variable round_1000 like mfc_logical
 label {&sosorp11_p_3} initial no.

/*N0K6*/ define variable disp-sales-fig  as character no-undo.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
part           colon 15
   part1          label {t001.i} colon 49 skip
   cust           colon 15
   cust1          label {t001.i} colon 49
/*D002*/ site     colon 15
/*D002*/ site1    label {t001.i} colon 49 skip(1)
   buyer          colon 22       start       colon 49
   prod_line      colon 22       dwm         colon 49
   ptgroup        colon 22       idays       colon 49
   part_type      colon 22
   vendor         colon 22
   pm_code        colon 22 skip(1)
   show_profit    colon 22
   round_1000     colon 22
   base_rpt       colon 22

 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K0L9*/ {wbrp01.i}


/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

/*FS87   do: */
     if start = ? then start = today - (12 * 7) + 1.
     if ending = ? then ending = today.
     if dwm = "" then dwm = "W".
     if idays = 0 or idays = ? then idays = 1.
     if part1 = hi_char then part1 = "".
/*D002*/ if site1 = hi_char then site1 = "".
/*D769*/ if cust1 = hi_char then cust1 = "".

/*K0L9*/ if c-application-mode <> 'web' then
    
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0L9*/ {wbrp06.i &command = update &fields = "  part part1 cust cust1  site site1
buyer prod_line ptgroup part_type vendor pm_code show_profit round_1000 base_rpt start
dwm idays" &frm = "a"}

/*K0L9*/ if (c-application-mode <> 'web') or
/*K0L9*/ (c-application-mode = 'web' and
/*K0L9*/ (c-web-request begins 'data')) then do:

     bcdparm = "".
     {mfquoter.i part        }
     {mfquoter.i part1       }
     {mfquoter.i cust        }
     {mfquoter.i cust1       }
/*D002*/ {mfquoter.i site        }
/*D002*/ {mfquoter.i site1       }
     {mfquoter.i buyer       }
     {mfquoter.i prod_line   }
     {mfquoter.i ptgroup     }
     {mfquoter.i part_type   }
     {mfquoter.i vendor      }
     {mfquoter.i pm_code     }
     {mfquoter.i show_profit }
     {mfquoter.i round_1000  }
     {mfquoter.i base_rpt    }
     {mfquoter.i start       }
     {mfquoter.i dwm         }
     {mfquoter.i idays       }

     if part1 = "" then part1 = hi_char.
     if cust1 = "" then cust1 = hi_char.
     if site1 = "" then site1 = hi_char.

     if index("dwmp",dwm) = 0 then do:
        {mfmsg.i 14 3} /* MUST BE (D)ay (W)eek OR (M)onth Please re-enter*/
/*K0L9*/    if c-application-mode = 'web' then return.
/*K0L9*/    else
/*FS87*/    /*GUI NEXT-PROMPT removed */
/*FS87*/    /*GUI UNDO removed */ RETURN ERROR.
     end.

/*K0L9*/ end.

         
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:


    {hksimsg.i site site1}      /*fdn*/

     {mfphead.i}

/*FS87   end. */

   /* COMPUTE START DATES */
   sdate[1] = low_date.
   {mfcsdate.i}

   /*D112*/ FORM /*GUI*/ 
/*N0K6 {&sosorp11_p_5} */
/*N0K6*/ disp-sales-fig no-label format "x(40)"
   with STREAM-IO /*GUI*/  frame footer page-bottom
/*G1P6*/ width 132.

/* SET EXTERNAL LABELS */
/*N0NM* setFrameLabels(frame footer:handle). */
/*N0K6*/ assign disp-sales-fig:screen-value in frame footer =
                    getTermLabel("SALES_FIGURES_IN_THOUSANDS",40).
   if round_1000 then view frame footer.

   /*B130*/
   {gprun.i ""hksosorpa1.p""}

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   hide message no-pause.
   {mfmsg.i 9 1}
end.

/*K0L9*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" part part1 cust cust1  site site1 buyer prod_line ptgroup part_type vendor pm_code show_profit round_1000 base_rpt start dwm idays "} /*Drive the Report*/
